//--------------------------------------------------------------//
// Pass 0
//--------------------------------------------------------------//

float4x4 matViewProjection;
float4x4 world;

struct VS_INPUT 
{
   float4 Position : POSITION0;
   float2 TexCoord: TEXCOORD0;   
};

struct VS_OUTPUT 
{
   float4 Position : POSITION0;
   float2 TexCoord: TEXCOORD0;
};

VS_OUTPUT VS_MAIN( VS_INPUT Input )
{
   VS_OUTPUT Output;
   
   Output.Position = mul( Input.Position, world );
   Output.Position = mul( Output.Position, matViewProjection );
   Output.TexCoord = Input.TexCoord;
   
   return( Output );   
}

#define STREIFEN 0.1

float4 PS_MAIN(VS_OUTPUT Input) : COLOR0
{      

    //  Output constant color:
   float4 color = float4( 0.0f, 0.0f, 0.0f, 0.0f );
   
   color.xy = Input.TexCoord;
   
      
   if ((Input.TexCoord.x % STREIFEN) > (STREIFEN/2))
   {
      if ((Input.TexCoord.y % STREIFEN) > (STREIFEN/2))
      {
         color = float4( 1.0f, 1.0f, 1.0f, 1.0f );
      }
      else
      {
         color = float4( 0.0f, 0.0f, 0.0f, 1.0f );
      }
   }
   else
   {
      if ((Input.TexCoord.y % STREIFEN) > STREIFEN/2)
      {
         color = float4( 0.0f, 0.0f, 0.0f, 1.0f );
      }
      else
      {
         color = float4( 1.0f, 1.0f, 1.0f, 1.0f );
      }
   }
   
   
   
   return( color );
}




//--------------------------------------------------------------//
// Technique Section for Schachbrett
//--------------------------------------------------------------//
technique Schachbrett
{
   pass Pass_0
   {
      VertexShader = compile vs_2_0 VS_MAIN();
      PixelShader = compile ps_2_0 PS_MAIN();
   }

}




